Skip to content

Add bounded split application messages - #984

Open
colonelpanic8 wants to merge 3 commits into
rmk-rs:mainfrom
colonelpanic8:glove80-rmk/split-app
Open

Add bounded split application messages#984
colonelpanic8 wants to merge 3 commits into
rmk-rs:mainfrom
colonelpanic8:glove80-rmk/split-app

Conversation

@colonelpanic8

Copy link
Copy Markdown
Contributor

What

  • add a 26-byte opaque application payload to the split wire protocol
  • expose bounded central-to-peripheral, peripheral-to-central, and receive queues
  • expose split-link state so applications can resynchronize after reconnects
  • keep key events ahead of application traffic and use drop-on-full semantics to preserve split responsiveness

Why

RMK-based firmware sometimes needs to coordinate application-owned state across halves without adding hardware-specific meaning to the core split protocol. Per-key lighting is one consumer, but this API stays opaque and allocation-free.

Impact

Existing split behavior is unchanged unless the new queues are used. The implementation currently targets a single split peripheral and documents that limitation.

Checks

  • repository formatter
  • full RMK feature-matrix tests
  • Rynk host tests, doctests, WASM checks/package typecheck, and clippy

@Schievel1

Copy link
Copy Markdown
Contributor

Iirc this is also useful to transport state of the keyboard to the peripheral that is not available in the usual split protocol right?

Like for example I have a special function in my firmware that moves the mouse pointer a bit automatically when it's active. And I have a display on the peripheral that should display whether it's active.
Could I use this PR for that?

Add an opaque, bounded application payload that firmware can exchange
between the split central and peripheral alongside the normal split
traffic, without ever taking priority over key events.

* `split_app` module: `SplitAppData` (a small, `MaxSize`, postcard
  length-prefixed payload) plus four statics — `SPLIT_APP_TX`
  (central -> peripheral), `SPLIT_APP_PERIPH_TX` (peripheral ->
  central), the symmetric `SPLIT_APP_RX` inbox, and the `SPLIT_APP_LINK`
  watch that reports split-link state to the application.
* Producers use `try_send` only (bounded, drop-on-full) so the split
  read/write loops never block or get starved by application traffic;
  key events are always polled first.
* The split driver and peripheral drain the application queues as the
  lowest-priority arm of their outgoing selects and forward received
  `SplitMessage::Application` payloads into the inbox.
* `SPLIT_APP_LINK` is state-based (a `Watch`), so a late-subscribing
  application still observes the current link state; the `false -> true`
  edge is a resync trigger. Link-down edges are emitted from a drop
  guard so they survive async cancellation of the split session.
* On the peripheral the link is raised on the FIRST inbound message from
  the central rather than on bare connection: over BLE, notifications to
  a central that has not yet subscribed are silently dropped, so the
  connection alone is not proof the application channel is usable.

Developed for a split keyboard port.
@colonelpanic8
colonelpanic8 force-pushed the glove80-rmk/split-app branch from 6f436cf to 0195a61 Compare August 5, 2026 08:12
@colonelpanic8
colonelpanic8 changed the base branch from feat/rynk to main August 5, 2026 08:12
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 397.8 KiB 397.8 KiB +0.00% 0 0 0
use_config/nrf52840_ble 439.4 KiB 439.4 KiB +0.00% ⬇️ -4 0 0
use_config/nrf52840_ble_split (central) 502.0 KiB 505.0 KiB +0.58% ⬆️ +1972 +48 +984
use_config/nrf52840_ble_split (peripheral) 320.9 KiB 323.4 KiB +0.77% ⬆️ +2088 +48 +408
use_config/pi_pico_w_ble 672.2 KiB 672.2 KiB +0.00% 0 0 0
use_config/rp2040 146.2 KiB 146.2 KiB +0.00% ⬇️ -4 0 0
use_config/rp2040_split (central) 159.7 KiB 162.3 KiB +1.60% ⬆️ +1588 0 +1044
use_config/rp2040_split (peripheral) 27.9 KiB 30.0 KiB +7.49% ⬆️ +1712 +52 +376
use_config/stm32f1 62.5 KiB 62.6 KiB +0.00% ⬆️ +4 0 0
use_config/stm32h7 100.8 KiB 100.8 KiB +0.00% ⬆️ +4 0 0
use_rust/nrf52832_ble 386.3 KiB 386.3 KiB +0.00% ⬇️ -4 0 0
use_rust/nrf52840_ble 436.2 KiB 436.2 KiB +0.00% ⬇️ -8 0 0
use_rust/nrf52840_ble_split (central) 505.6 KiB 508.5 KiB +0.57% ⬆️ +1968 +48 +984
use_rust/nrf52840_ble_split (peripheral) 318.9 KiB 321.4 KiB +0.76% ⬆️ +2056 +48 +408
use_rust/pi_pico_w_ble 672.0 KiB 672.0 KiB +0.00% ⬇️ -12 0 0
use_rust/rp2040 145.5 KiB 145.5 KiB +0.00% ⬇️ -4 0 0
use_rust/rp2040_split (central) 158.2 KiB 160.9 KiB +1.70% ⬆️ +1740 0 +1024
use_rust/rp2040_split (peripheral) 28.2 KiB 30.4 KiB +7.45% ⬆️ +1728 +52 +376
use_rust/stm32f1 61.8 KiB 61.8 KiB +0.00% ⬇️ -4 0 0
use_rust/stm32h7 119.6 KiB 119.6 KiB +0.00% 0 0 0
use_config/nrf52832_ble — 397.8 KiB → 397.8 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 365272	   8620	  33472	 407364	  63744	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 365272	   8620	  33472	 407364	  63744	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +2.4%      +1  [ = ]       0    [Unmapped]
  -0.0%      -2  [ = ]       0    .debug_loc
  -0.0%     -52  [ = ]       0    .strtab
  -0.9%     -70  [ = ]       0    .debug_abbrev
  -0.0%    -118  [ = ]       0    .debug_info
  -0.0%    -123  [ = ]       0    .debug_str
  -0.0%    -132  [ = ]       0    .debug_line
  -0.0%    -496  [ = ]       0    TOTAL
use_config/nrf52840_ble — 439.4 KiB → 439.4 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 397840	   8628	  43496	 449964	  6ddac	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 397844	   8628	  43496	 449968	  6ddb0	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.0%      -2  [ = ]       0    .debug_loc
  -0.0%      -4  -0.0%      -4    .text
  -0.0%     -10  [ = ]       0    .debug_str
  -0.0%     -12  [ = ]       0    .strtab
 -37.8%     -28  [ = ]       0    [Unmapped]
  -0.0%     -56  -0.0%      -4    TOTAL
use_config/nrf52840_ble_split (central) — 502.0 KiB → 505.0 KiB (+0.58% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 458712	   8732	  49648	 517092	  7e3e4	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 456740	   8684	  48664	 514088	  7d828	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.0% +48.3Ki  [ = ]       0    .debug_str
  +0.5% +12.7Ki  [ = ]       0    .debug_info
  +0.7% +2.75Ki  [ = ]       0    .strtab
  +0.4% +1.67Ki  +0.4% +1.67Ki    .text
  +0.3% +1.20Ki  [ = ]       0    .debug_line
  +0.4% +1.03Ki  [ = ]       0    .debug_ranges
  [ = ]       0  +2.1%    +984    .bss
  +0.4%    +672  [ = ]       0    .symtab
  +0.1%    +481  [ = ]       0    .debug_loc
  +0.6%    +356  [ = ]       0    .debug_frame
  +0.6%    +264  +0.6%    +264    .rodata
  +0.4%    +176  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
  +0.5%     +42  [ = ]       0    .debug_abbrev
  +0.1%      +1  [ = ]       0    .defmt
 -13.4%      -9  [ = ]       0    [Unmapped]
  +0.7% +69.7Ki  +0.6% +2.93Ki    TOTAL
use_config/nrf52840_ble_split (peripheral) — 320.9 KiB → 323.4 KiB (+0.77% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 294804	   8548	  27832	 331184	  50db0	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 292716	   8500	  27424	 328640	  503c0	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.7% +57.1Ki  [ = ]       0    .debug_str
  +1.0% +16.2Ki  [ = ]       0    .debug_info
  +0.6% +3.17Ki  [ = ]       0    .debug_loc
  +1.1% +2.81Ki  [ = ]       0    .strtab
  +1.4% +2.30Ki  [ = ]       0    .debug_ranges
  +0.8% +1.92Ki  [ = ]       0    .debug_line
  +0.7% +1.82Ki  +0.7% +1.82Ki    .text
  +0.4%    +432  [ = ]       0    .symtab
  [ = ]       0  +1.5%    +408    .bss
  +0.8%    +260  [ = ]       0    .debug_frame
  +0.7%    +228  +0.7%    +228    .rodata
  +0.3%    +120  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
  +0.2%      +1  [ = ]       0    .defmt
  +1.9%      +1  [ = ]       0    [Unmapped]
  +1.3% +86.4Ki  +0.8% +2.48Ki    TOTAL
use_config/pi_pico_w_ble — 672.2 KiB → 672.2 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 635312	      0	  53024	 688336	  a80d0	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 635312	      0	  53024	 688336	  a80d0	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +360  [ = ]       0    .debug_info
  +0.0%    +205  [ = ]       0    .debug_str
  +0.0%     +24  [ = ]       0    .debug_line
  +0.0%     +10  [ = ]       0    .debug_loc
  +6.3%      +4  [ = ]       0    [Unmapped]
  -0.0%     -11  [ = ]       0    .strtab
  +0.0%    +592  [ = ]       0    TOTAL
use_config/rp2040 — 146.2 KiB → 146.2 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 135788	      0	  13892	 149680	  248b0	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135792	      0	  13892	 149684	  248b4	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +124  [ = ]       0    .debug_str
  +0.0%     +80  [ = ]       0    .debug_line
  +0.0%     +37  [ = ]       0    .debug_info
  +0.0%      +6  [ = ]       0    .strtab
  -0.0%      -4  -0.0%      -4    .text
 -36.5%     -23  [ = ]       0    [Unmapped]
  +0.0%    +220  -0.0%      -4    TOTAL
use_config/rp2040_split (central) — 159.7 KiB → 162.3 KiB (+1.60% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 150332	      0	  15872	 166204	  2893c	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 148744	      0	  14828	 163572	  27ef4	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +2.4% +48.8Ki  [ = ]       0    .debug_str
  +1.5% +16.5Ki  [ = ]       0    .debug_info
  +1.3% +4.55Ki  [ = ]       0    .debug_loc
  +1.3% +1.71Ki  [ = ]       0    .strtab
  +0.8% +1.48Ki  [ = ]       0    .debug_line
  +1.5% +1.33Ki  [ = ]       0    .debug_ranges
  +1.0% +1.31Ki  +1.0% +1.31Ki    .text
  [ = ]       0  +7.6% +1.02Ki    .bss
  +1.0%    +352  [ = ]       0    .symtab
  +1.1%    +196  +1.1%    +196    .rodata
  +1.0%    +188  [ = ]       0    .debug_frame
  +0.5%     +96  [ = ]       0    .debug_aranges
   +29%     +52   +37%     +52    .data
   +34%     +14  [ = ]       0    [Unmapped]
  +0.2%      +1  [ = ]       0    .defmt
  +1.9% +76.5Ki  +1.6% +2.57Ki    TOTAL
use_config/rp2040_split (peripheral) — 27.9 KiB → 30.0 KiB (+7.49% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  27408	    112	   3180	  30700	   77ec	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25696	     60	   2804	  28560	   6f90	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +6.3% +53.1Ki  [ = ]       0    .debug_str
  +4.8% +18.5Ki  [ = ]       0    .debug_info
  +5.4% +3.80Ki  [ = ]       0    .debug_loc
  +3.2% +1.80Ki  [ = ]       0    .debug_line
   +10% +1.69Ki  [ = ]       0    .debug_ranges
  +6.2% +1.52Ki  [ = ]       0    .strtab
  +7.3% +1.48Ki  +7.4% +1.48Ki    .text
  [ = ]       0   +21%    +376    .bss
  +3.6%    +320  [ = ]       0    .symtab
  +4.2%    +196  +4.2%    +196    .rodata
  +2.9%    +160  [ = ]       0    .debug_frame
  +0.7%     +96  [ = ]       0    .debug_aranges
   +52%     +52   +87%     +52    .data
  +0.4%     +26  [ = ]       0    .debug_abbrev
  +0.5%      +1  [ = ]       0    .defmt
 -11.8%      -6  [ = ]       0    [Unmapped]
  +5.7% +82.7Ki  +7.5% +2.09Ki    TOTAL
use_config/stm32f1 — 62.5 KiB → 62.6 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57688	     28	   6336	  64052	   fa34	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57684	     28	   6336	  64048	   fa30	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +4  +0.0%      +4    .text
  -7.6%      -5  [ = ]       0    [Unmapped]
  -0.0%      -6  [ = ]       0    .debug_line
  -0.0%      -9  [ = ]       0    .strtab
  -0.0%     -64  [ = ]       0    .debug_str
  -0.0%     -80  +0.0%      +4    TOTAL
use_config/stm32h7 — 100.8 KiB → 100.8 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  94844	    264	   8112	 103220	  19334	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  94840	    264	   8112	 103216	  19330	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2%    +268  [ = ]       0    .debug_line
  +0.0%     +37  [ = ]       0    .debug_str
  +0.0%     +36  [ = ]       0    .debug_info
  +0.0%      +4  +0.0%      +4    .text
  -8.0%      -4  [ = ]       0    [Unmapped]
  -0.0%      -9  [ = ]       0    .strtab
  +0.0%    +332  +0.0%      +4    TOTAL
use_rust/nrf52832_ble — 386.3 KiB → 386.3 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 353504	   8620	  33448	 395572	  60934	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 353508	   8620	  33448	 395576	  60938	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +21  [ = ]       0    .debug_str
  +0.0%      +5  [ = ]       0    .strtab
  +6.0%      +4  [ = ]       0    [Unmapped]
  +0.0%      +2  [ = ]       0    .debug_line
  -0.0%      -4  -0.0%      -4    .text
  +0.0%     +28  -0.0%      -4    TOTAL
use_rust/nrf52840_ble — 436.2 KiB → 436.2 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 397264	   8628	  40744	 446636	  6d0ac	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 397272	   8628	  40744	 446644	  6d0b4	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.0%      -8  -0.0%      -8    .text
  -0.0%     -10  [ = ]       0    .debug_loc
 -35.3%     -24  [ = ]       0    [Unmapped]
  -0.0%     -44  [ = ]       0    .strtab
  -0.0%     -48  [ = ]       0    .debug_info
  -0.0%    -132  [ = ]       0    .debug_str
  -0.1%    -210  [ = ]       0    .debug_line
  -0.0%    -476  -0.0%      -8    TOTAL
use_rust/nrf52840_ble_split (central) — 505.6 KiB → 508.5 KiB (+0.57% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 460380	   8732	  51616	 520728	  7f218	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 458412	   8684	  50632	 517728	  7e660	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.1% +50.9Ki  [ = ]       0    .debug_str
  +0.6% +14.2Ki  [ = ]       0    .debug_info
  +0.6% +2.53Ki  [ = ]       0    .strtab
  +0.5% +1.79Ki  [ = ]       0    .debug_line
  +0.4% +1.67Ki  +0.4% +1.67Ki    .text
  +0.6% +1.50Ki  [ = ]       0    .debug_ranges
  [ = ]       0  +2.0%    +984    .bss
  +0.1%    +955  [ = ]       0    .debug_loc
  +0.3%    +432  [ = ]       0    .symtab
  +0.6%    +256  +0.6%    +256    .rodata
  +0.4%    +232  [ = ]       0    .debug_frame
  +0.2%    +120  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
  +0.1%      +1  [ = ]       0    .defmt
  +0.8% +74.6Ki  +0.6% +2.93Ki    TOTAL
use_rust/nrf52840_ble_split (peripheral) — 318.9 KiB → 321.4 KiB (+0.76% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 292932	   8548	  27600	 329080	  50578	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 290876	   8500	  27192	 326568	  4fba8	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.8% +57.7Ki  [ = ]       0    .debug_str
  +1.1% +17.1Ki  [ = ]       0    .debug_info
  +0.8% +4.48Ki  [ = ]       0    .debug_loc
  +1.1% +2.75Ki  [ = ]       0    .strtab
  +1.4% +2.27Ki  [ = ]       0    .debug_ranges
  +0.9% +2.09Ki  [ = ]       0    .debug_line
  +0.7% +1.77Ki  +0.7% +1.77Ki    .text
  [ = ]       0  +1.6%    +408    .bss
  +0.4%    +384  [ = ]       0    .symtab
  +0.7%    +244  [ = ]       0    .debug_frame
  +0.7%    +240  +0.7%    +240    .rodata
  +0.3%    +120  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
  +1.4%      +9  [ = ]       0    .defmt
 -33.9%     -21  [ = ]       0    [Unmapped]
  +1.4% +89.2Ki  +0.8% +2.45Ki    TOTAL
use_rust/pi_pico_w_ble — 672.0 KiB → 672.0 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 634992	      0	  53128	 688120	  a7ff8	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 635004	      0	  53128	 688132	  a8004	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +24%     +13  [ = ]       0    [Unmapped]
  +0.0%     +10  [ = ]       0    .debug_loc
  +0.0%      +5  [ = ]       0    .debug_info
  -0.0%      -7  [ = ]       0    .debug_line
  -0.0%     -12  -0.0%     -12    .text
  -0.0%     -28  [ = ]       0    .strtab
  -0.0%     -53  [ = ]       0    .debug_str
  -0.0%     -72  -0.0%     -12    TOTAL
use_rust/rp2040 — 145.5 KiB → 145.5 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 135288	      0	  13732	 149020	  2461c	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135292	      0	  13732	 149024	  24620	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%     +91  [ = ]       0    .debug_line
  +0.0%     +52  [ = ]       0    .debug_str
  +0.0%     +46  [ = ]       0    .debug_info
  +1.9%      +1  [ = ]       0    [Unmapped]
  -0.0%      -2  [ = ]       0    .strtab
  -0.0%      -4  -0.0%      -4    .text
  +0.0%    +184  -0.0%      -4    TOTAL
use_rust/rp2040_split (central) — 158.2 KiB → 160.9 KiB (+1.70% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 149216	      0	  15596	 164812	  283cc	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 147476	      0	  14572	 162048	  27900	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +2.6% +51.4Ki  [ = ]       0    .debug_str
  +1.4% +15.9Ki  [ = ]       0    .debug_info
  +1.0% +3.37Ki  [ = ]       0    .debug_loc
  +1.7% +2.19Ki  [ = ]       0    .strtab
  +0.8% +1.51Ki  [ = ]       0    .debug_line
  +1.2% +1.46Ki  +1.2% +1.46Ki    .text
  +1.5% +1.38Ki  [ = ]       0    .debug_ranges
  [ = ]       0  +7.6%   +1024    .bss
  +1.2%    +448  [ = ]       0    .symtab
  +1.1%    +196  +1.1%    +196    .rodata
  +1.0%    +188  [ = ]       0    .debug_frame
  +0.6%    +104  [ = ]       0    .debug_aranges
   +29%     +52   +37%     +52    .data
  +0.2%      +1  [ = ]       0    .defmt
 -14.5%      -9  [ = ]       0    [Unmapped]
  +1.9% +78.1Ki  +1.7% +2.70Ki    TOTAL
use_rust/rp2040_split (peripheral) — 28.2 KiB → 30.4 KiB (+7.45% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  27524	    112	   3444	  31080	   7968	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25796	     60	   3068	  28924	   70fc	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +6.3% +54.0Ki  [ = ]       0    .debug_str
  +5.0% +19.3Ki  [ = ]       0    .debug_info
   +13% +8.86Ki  [ = ]       0    .debug_loc
  +3.2% +1.81Ki  [ = ]       0    .debug_line
  +9.9% +1.62Ki  [ = ]       0    .debug_ranges
  +6.5% +1.56Ki  [ = ]       0    .strtab
  +7.4% +1.49Ki  +7.4% +1.49Ki    .text
  +4.5%    +384  [ = ]       0    .symtab
  [ = ]       0   +18%    +376    .bss
  +4.1%    +200  +4.2%    +200    .rodata
  +3.0%    +160  [ = ]       0    .debug_frame
  +0.7%     +96  [ = ]       0    .debug_aranges
   +52%     +52   +87%     +52    .data
   +16%      +8  [ = ]       0    [Unmapped]
  +0.5%      +1  [ = ]       0    .defmt
  +6.1% +89.5Ki  +7.5% +2.11Ki    TOTAL
use_rust/stm32f1 — 61.8 KiB → 61.8 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57012	     28	   6272	  63312	   f750	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57016	     28	   6272	  63316	   f754	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.05Ki  [ = ]       0    .debug_str
  +0.3%    +116  [ = ]       0    .strtab
  +0.0%      +6  [ = ]       0    .debug_line
  +8.6%      +5  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  +0.1% +1.17Ki  -0.0%      -4    TOTAL
use_rust/stm32h7 — 119.6 KiB → 119.6 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 108172	    320	  14012	 122504	  1de88	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 108172	    320	  14012	 122504	  1de88	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +6  [ = ]       0    .strtab
  -5.4%      -2  [ = ]       0    [Unmapped]
  -0.0%     -35  [ = ]       0    .debug_str
  -0.0%     -46  [ = ]       0    .debug_info
  -0.2%    -283  [ = ]       0    .debug_line
  -0.0%    -360  [ = ]       0    TOTAL

@colonelpanic8
colonelpanic8 marked this pull request as ready for review August 5, 2026 08:59
Move the duplicated inline LinkDownGuard structs into split_app as a
single LinkGuard that also owns the idempotent link-up edge, extract the
peripheral's central-message match into handle_central_message so it is
no longer nested five levels deep inside run(), share the drop-on-full
inbox delivery between both sides, and trim comments down to the
non-obvious facts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HaoboGu

HaoboGu commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

what is this message used for?

@Schievel1

Copy link
Copy Markdown
Contributor

Would be good to have some docs on how to use this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants